/**
 * vue插件：注册项目所有的全局组件
 * v2和v3编写插件的变化
 * 1.整体写法不变
 * 2.install方法的第一个参数发生变化=>APP实例 | v2的install方法的第一个参数是vue构造函数
 */
import Skeleton from './Skeleton/index.vue'
import XtxSlider from './Slider/index.vue'
import XtxMore from './More/index.vue'
import XtxBread from './Bread/index.vue'
import XtxBreadItem from './Bread/item.vue'
import XtxInfiniteLoad from './InfiniteLoad/index.vue'
import XtxCity from './City/index.vue'
import GoodsSku from './Sku/index.vue'
import XtxNumbox from './Numbox/index.vue'
import XtxButton from './Button/index.vue'
const cps = [Skeleton, XtxSlider, XtxMore, XtxBread, XtxBreadItem, XtxInfiniteLoad, XtxCity, GoodsSku, XtxNumbox, XtxButton]
export default {
  install (app) {
    // console.log('实例', app)
    // 手动注册
    // app.component('Skeleton', Skeleton)
    // 循环自动注册
    cps.forEach(item => {
      app.component(item.name, item)
    })
  }
}
